<%@ Page Language="c#" Inherits="SystemManager_ShowAttachment"
    CodeFile="ShowAttachment.aspx.cs" %>

<%
    String aID = Request["aID"];
    if (string.IsNullOrEmpty(aID))
    {
        return;
    }

    string strSql = "select data from st_attachment where aid='" + aID + "' order by magic_number desc";
    System.Data.IDataReader idrGet = WF_Business.SysParams.OAConnection().GetDataReader(strSql);

    if (idrGet.Read())
    {
        System.IO.Stream strmRead = new System.IO.MemoryStream((byte[])idrGet["data"]);

        byte[] buffer = new byte[strmRead.Length];
        strmRead.Read(buffer, 0, buffer.Length);
        idrGet.Close();
        Response.OutputStream.Write(buffer, 0, buffer.Length);
    }
    else
    {
        idrGet.Close();
        byte[] buffer = new byte[] { 66, 77, 58, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 40, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        Response.OutputStream.Write(buffer, 0, buffer.Length);
    }
	
%>
